package com.learn.hibernatevalidator.chapter12.failfastonpropertyviolation;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import org.hibernate.validator.constraints.ISBN;


@NonSelfPublishing
public class Book {

    @ISBN
    private String isbn;

    @NotBlank
    private String title;

    @NotNull
    private Person author;

    @NotNull
    private Person publisher;


    public Book(String isbn, String title, Person author, Person publisher) {
        this.isbn = isbn;
        this.title = title;
        this.author = author;
        this.publisher = publisher;
    }

    public String getIsbn() {
        return this.isbn;
    }

    public String getTitle() {
        return this.title;
    }

    public Person getAuthor() {
        return this.author;
    }

    public Person getPublisher() {
        return this.publisher;
    }

}
